home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1191_window_memory_leak.rtf < prev    next >
Text File  |  1995-06-12  |  1KB  |  21 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Ohlfs;}
  2. \paperw12940
  3. \paperh9000
  4. \margl120
  5. \margr1000
  6. {\colortbl;\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q:  I am writing a simple editor program, which loads in a nib file for each document created.  I noticed with MallocDebug that there is a consistent leak of  22 bytes for every newly created document window, even though the documentation says that the default window is to be freed when closed.  Why is it leaking?\
  8. \
  9. A:  The default window created with InterfaceBuilder is somewhat different from the default window created with the methods 
  10. \b alloc 
  11. \b0 and 
  12. \b initContent:style:backing:buttonMask
  13. \b0 .  The InterfaceBuilder default window is not automatically freed when closed.  To fix this problem, simply check the "Free when closed" option in the Window Attributes Panel, using the InterfaceBuilder Projects inspector.\
  14.  
  15. \fc1\cf1 \
  16. QA790\
  17. \
  18. Valid for 1.0, 2.0, 3.0\
  19. \
  20.  
  21.